<?php if(count($this->list) == 0) { ?>
	<div class="msg" style="text-align:left;">
		<div class="common error" style="border:0;background:#fff;">
			<i class="icon"></i>
			<h4>STOP</h4>
			<div class="msg-bd">No Photo found. </div>
		</div>
	</div>
<?php } else { ?>
	<?php 
		$language = new system_setting_language();
		$previous = $this->page - 1;
		$next = $this->page + 1;
		$page = $this->paginator($this->list)->render();
		$page = preg_replace('#<a href="[^"]+">([\d]+)</a>#isU', '<a href="#$1" onclick="return _ajax.load($1);">$1</a>', $page);
		$page = preg_replace('#<a class="previous" href="[^"]+">([^<]+)</a>#isU', '<a href="#' . $previous . '" onclick="return _ajax.load(' . $previous . ');">$1</a>', $page);
		$page = preg_replace('#<a class="next" href="[^"]+">([^<]+)</a>#isU', '<a href="#' . $next . '" onclick="return _ajax.load(' . $next . ');">$1</a>', $page);
	?>
	<table class="list no-border">
		<tr>
		<?php 
		$count = count($this->list);
		$key = 1;
		foreach($this->list AS $row) {
		?>
			<td class="icon">
				<div style="float:left;position:relative;">
				<a href="<?php echo $row->getImage()->getLarge(false);?>" target="_blank" style="float:left;">
				<img src="<?php echo $row->getImage()->getThumb(false);?>" title="<?php echo $this->escape($row->getTitle());?>" />
				</a>
				<span style="position:absolute;left:1px;top:1px;padding:1px;background:#fff;">
				<input type="checkbox" name="_photo_id[]" id="_photo_id-<?php echo $row->getId();?>" value="<?php echo $row->getId();?>" onclick="_ajax.select(<?php echo $row->getId();?>)" />
				</span>
				<div class="hidden" id="photo-title-<?php echo $row->getId();?>"><?php echo $this->escape($row->getTitle());?>[<?php echo $row->getHash();?>]</div>
				</div>
			</td>
		<?php
			if($key % 6 == 0 && $key < $count) {
				echo '</tr><tr>';
			}
			$key ++;
		}
		for($i = 0; $i < ((6 - $count % 6) % 6); $i ++) {
			echo '<td style="width:' . intval(100/6) . '%">&nbsp;</td>';
		}		
		?>
		</tr>
	</table>
	<hr/>
	<div style="clear:both;text-align:left;padding:4px 2px;"><?php echo $page;?></div>
<?php } ?>